import request from '@/utils/request'

// 获取优惠券活动列表
export function pageAction(query) {
  return request({
    url: '/sell/couponAction/paging',
    method: 'get',
    params: query
  })
}

// 统计优惠券活动
export function statAction(query) {
  return request({
    url: '/sell/couponAction/statAction',
    method: 'get',
    params: query
  })
}

// 获取优惠券活动
export function getAction(actionId) {
  return request({
    url: '/sell/couponAction/get',
    method: 'get',
    params: { actionId }
  })
}

// 保存优惠券活动
export function saveAction(action) {
  return request({
    url: '/sell/couponAction/save',
    method: 'post',
    data: action
  })
}

// 发布优惠券活动
export function publishAction(actionId) {
  return request({
    url: '/sell/couponAction/doPublish',
    method: 'post',
    params: { actionId }
  })
}

// 发放优惠券
export function sendCoupon(actionId) {
  return request({
    url: '/sell/couponAction/doSendCoupon',
    method: 'post',
    params: { actionId }
  })
}

// 结束优惠券活动
export function endAction(action) {
  return request({
    url: '/sell/couponAction/doEnd',
    method: 'post',
    params: action
  })
}

// 删除优惠券活动
export function deleteAction(actionId) {
  return request({
    url: '/sell/couponAction/delete',
    method: 'post',
    params: { actionId }
  })
}
